package com.richper.springcloudh2020.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@Slf4j
@RequestMapping(value = "/consumer/consul")
public class OrderController {


    @Autowired
    private RestTemplate restTemplate;

    private final String url = "http://cloud-provider-payment";

    @GetMapping(value = "/consulGet")
    public  String consul_get(){
        return restTemplate.getForObject(url+"/payment/consul/consulGet",String.class);
    }
}
